package com.qianguo.buyer.entity;

import android.os.Parcel;
import android.os.Parcelable;

import com.alibaba.fastjson.annotation.JSONField;
import com.eva.androidlibrary.api.entity.BaseBean;

import java.util.List;

/**
 * @author eva
 * @date 16/6/28
 */
public class ShopCar extends BaseBean implements Parcelable {
    /**
     * 商品数目
     */
    @JSONField(name = "num")
    private int num;
    /**
     * 总价
     */
    @JSONField(name = "total_price")
    private int total_price;

    /** 详情图 */
    @JSONField(name = "goods")
    private List<ShopCarItem> goods;

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    public int getTotal_price() {
        return total_price;
    }

    public void setTotal_price(int total_price) {
        this.total_price = total_price;
    }

    public List<ShopCarItem> getGoods() {
        return goods;
    }

    public void setGoods(List<ShopCarItem> goods) {
        this.goods = goods;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.num);
        dest.writeInt(this.total_price);
        dest.writeTypedList(this.goods);
    }

    public ShopCar() {
    }

    protected ShopCar(Parcel in) {
        this.num = in.readInt();
        this.total_price = in.readInt();
        this.goods = in.createTypedArrayList(ShopCarItem.CREATOR);
    }

    public static final Creator<ShopCar> CREATOR = new Creator<ShopCar>() {
        @Override
        public ShopCar createFromParcel(Parcel source) {
            return new ShopCar(source);
        }

        @Override
        public ShopCar[] newArray(int size) {
            return new ShopCar[size];
        }
    };
}
